package com.lemon.components.ant.util.freemarker;

import java.util.List;

import com.system.core.security.NameUtil;

import freemarker.template.SimpleScalar;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

public class WhereColumnCover implements TemplateMethodModelEx{

	@Override
	public Object exec(List arguments) throws TemplateModelException {
		String name = ((SimpleScalar)arguments.get(0)).getAsString();
		String names[] = name.split("\\.");
		if(names.length>1) {
			return NameUtil._2JavaName(names[1]);
		} else if (names.length==1){
			return NameUtil._2JavaName(names[0]);
		} else {
			return name;
		}
	}

}
